import React from "react";

import { bindActionCreators } from "../../my-redux";
import ReactReduxContext from "../ReactReduxContext";

function useBoundDispatch(actions) {
  const { store } = React.useContext(ReactReduxContext);
  let boundActions = bindActionCreators(actions, store.dispatch);
  return boundActions;
}

export default useBoundDispatch;
